

import { DetailRoutes } from '@/views/Detail/route'
import { ErrorRoutes } from '@/views/ErrorPage/route'
import { LoginRoutes } from '@/views/Logins/route'
import { MsRoutes } from '@/views/Ms/route'
import { MyRoutes } from '@/views/Mys/route'
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)


const routes = [
  {
    path:"/",
    redirect:"/guide"
  },
  {
    path:"/demo",
    component:()=>import('@/components/Demo.vue')
  },
  {
    path:"/guide",
    name:'guide',
    component:()=>import('@/views/Guide/Guide.vue')
  },
  {
    path:"/search",
    name:'search',
    component:()=>import('@/views/Search/Search.vue')
  },
  ...DetailRoutes,
  ...MyRoutes,
  ...MsRoutes,
  ...LoginRoutes,
  ...ErrorRoutes,
  {
    path:"*",
    redirect:"/404"
  }
]

const router = new VueRouter({
  routes,
  mode:'hash'
})

router.beforeEach((to,from,next)=>{
  next()
})

export default router;
